package com.ad.pet.common.data.utils.upload;

import android.content.Context;

import com.ad.pet.Adapter;

import javax.inject.Inject;


/**
 * Created by zwb on.
 * Des:
 * Date: 2017/8/7
 */

public class UploadFiles implements Adapter {
    private static final String TAG = "UploadFiles";
    private Context mContext;

    @Inject
    public UploadFiles(Context context) {
        mContext = context;
    }

    @Override
    public void upload(String comment) throws Exception {
//        Logger.e(comment);
//        UserDbBean userDbBean = UserDbManager.getInstance().loadFirst();
//        if (userDbBean != null) {
//            Intent startIntent = new Intent(mContext, UploadService.class);
//            startIntent.putExtra("url", Urls.getServerIp() + mContext.getResources().getString(R.string.feedback));
//            startIntent.putExtra("phone", userDbBean.getPn());
//            mContext.startService(startIntent);
//        }
    }

//    public void upLoadError() {
//        if (SpUtil.getInstance().getBoolean(TokenKey.ERROR, false)) {
//            String zip = Logger.zip();
//            UserDbBean userDbBean = UserDbManager.getInstance().loadFirst();
//            String pn = userDbBean != null ? userDbBean.getPn() : "";
//            mApiService.feedback("崩溃日志", pn, zip)
//                    .subscribe(new Subscriber<ResultBean>() {
//                        @Override
//                        public void onCompleted() {
//                            Logger.d(TAG, "onCompleted");
//                        }
//
//                        @Override
//                        public void onError(Throwable e) {
//                            Logger.e(TAG, "上传日志失败", e);
//                        }
//
//                        @Override
//                        public void onNext(ResultBean resultBean) {
//                            Logger.d(TAG, "上传成功");
//                            FileUtil.getInstance().deleteFolder(FileUtil.getInstance().getLogDir().getPath());
//                        }
//                    });
//        }
//    }
}
